﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.Text.Editor;
using FunctionPoint.Adornment;
using FunctionPoint.Common;
using System.Windows;
using Microsoft.VisualStudio.Text;
using System.Windows.Controls;
using System.Windows.Media;

namespace FunctionPoint.Adornments
{
    public class WorkItemAdornment
    {
        private IWpfTextView _wpfTextView;
        
// private IAdornmentLayer _adornmentLayer;
        private Control _localControl;
        private WorkItem _workItem;
        //private bool _isAttached = false;
        public ITrackingPoint TrackingPoint
        {
            get;
            set;
        }
        public ITrackingSpan TrackingSpan
        {
            get;
            set;
        }
        public WorkItem WorkItem
        {
            get
            {
                return _workItem;
            }
        }

        public WorkItemAdornment(WorkItem workItem, IWpfTextView wpfTextView, ITextSnapshot snapShot)
        {
            _workItem = workItem;
            _wpfTextView = wpfTextView;

            TrackingPoint = snapShot.CreateTrackingPoint(workItem.ClosestCharacterPosition, 
                PointTrackingMode.Positive, TrackingFidelityMode.Forward);

            _localControl = new FunctionPointViewPortAdornmentControl();
            _localControl.DataContext = workItem;

            
            
       }

        public Control VisualElement
        {
            get
            {
                return _localControl;
            }

        }
        
    }
}
